package com.zoke.support.base;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import com.zoke.support.swipelayout.lib.SwipeAdapter;

/**
 * 封装侧滑基类 布局中要有SwipeLayout TODO:有bug 需要调试
 * 
 * @author JackWu
 * @version 1.0
 * @date 2014-10-23
 * @_QQ_ 651319154
 */
public abstract class BaseSwipeObjListAdapter extends SwipeAdapter {

	protected Context mContext;
	protected LayoutInflater mInflater;
	protected List<? extends Object> mDatas;// 数据集合

	public BaseSwipeObjListAdapter(Context context, List<? extends Object> datas) {
		mContext = context;
		mInflater = LayoutInflater.from(context);
		if (datas != null) {
			mDatas = datas;
		}
	}

	@Override
	public int getCount() {
		return mDatas.size();
	}

	@Override
	public Object getItem(int position) {
		return mDatas.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

}
